{include file="header.html"}
<body class="gr">

<div class="navBar">
	<a class="left" href="javascript:history.back()"><i class="return"></i></a>
	<div class="titleView-x">申请减员</div>
</div>

<div class="person-reduce main-top">
	<div class="list">
		{foreach from=$data item=g}
		<div class="view" person-id="{$g->id}" person-name="{$g->name}">
			<div class="left">
				<div class="checkbox" value="{$g->id}"></div>
			</div>
			<div class="right">
				<div class="name ge-bottom">{$g->name}</div>
				<span>城市：{$g->city_name}</span>
				<span>手机号：{$g->mobile}</span>
				<span>身份证号：{$g->idcard}</span>
				<span>户籍类型：{$g->type}</span>
			</div>
		</div>
		{foreachelse}
		<div class="norecord">没有任何记录</div>
		{/foreach}
	</div>
	
	{if is_array($data) && count($data)}
	<div class="buttonView">
		<a class="btn" href="javascript:void(0)">提交</a>
	</div>
	{/if}
</div>

{include file="footer.html"}
<script>
$(function(){
	$('.view').click(function(){
		$(this).find('.checkbox').toggleClass('checkbox-x');
	});
	$('.btn').click(function(){
		if(!$('.checkbox-x').length){
			$.overloadError('请选择人员');
			return;
		}
		if(!confirm('请问您确定要减员吗？'))return;
		var id = [];
		$('.checkbox-x').each(function(){
			id.push($(this).attr('value'));
		});
		$.postJSON('api.php?app=member&act=person_reduce', { id:id.join(',') }, function(json){
			if(json.error!=0){ $.overloadError(json.msg);return }
			$.overloadSuccess('已提交申请，请耐心等待审核');
		});
	});
});
</script>